import { Graph, Shape } from '@antv/x6';

export function init() {
  Graph.registerEdge(
    'bpmn-edge',
    {
      inherit: 'edge',
      connector: { name: 'rounded' },
      markup: [
        {
          tagName: 'text',
          selector: 'signText',
        },
        {
          tagName: 'path',
          selector: 'line',
        },
        {
          tagName: 'rect',
          selector: 'signRect',
        },
        {
          tagName: 'text',
          selector: 'rectText',
        },
      ],
      
      attrs: {
        line: {
          connection: true,
          fill: 'none',
          stroke: '#222',
          strokeWidth: 2,
          strokeLinejoin: 'round',
          targetMarker: {
            name: 'classic',
          },
          zIndex: 1,
        },
        
        signRect: {
          x: 0,
          y: -5,
          width: 20,
          height: 10,
          opacity: 0,
          stroke: '#E6A23C',
          fill: '#E6A23C',
          atConnectionLength: -50,
          strokeWidth: 1,
          cursor: 'pointer',
        },
        
      },
    },
    true,
  );
}
